/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.pbv.azsg.domain;

import java.io.Serializable;
import java.math.BigInteger;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Enumerated;
import javax.persistence.EnumType;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author pbv
 */
@Entity
@Table(catalog = "PBV", schema = "")
@XmlRootElement
public class Fuelling implements Serializable {
    
    private static final long serialVersionUID = 1L;
    
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Basic(optional = false)
    @Column(nullable = false)
    private Long id;
    
    @Basic(optional = false)
    @Column(nullable = false)
    private long dispenser;
    
    @Basic(optional = false)
    @Column(nullable = false)
    private long fuel;
    
    @Basic(optional = false)
    @Column(nullable = false)
    private long price;
    
    @Basic(optional = false)
    @Column(nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date requested;
    
    @Basic(optional = false)
    @Column(nullable = false)
    private long reqvolume;
    
    @Basic(optional = false)
    @Column(nullable = false)
    private long reqpaysum;
    
    @Basic(optional = false)
    @Column(nullable = false)
    @Enumerated(EnumType.ORDINAL)
    private FuellingStatus status;
    
    @Basic(optional = false)
    @Column(nullable = false)
    @Temporal(TemporalType.TIMESTAMP)
    private Date fuelled;
    
    @Basic(optional = true)
    @Column(nullable = true)
    private BigInteger fuelvolume;
    
    @Basic(optional = true)
    @Column(nullable = true)
    private BigInteger fuelpaysum;
    
    @Column(length = 255)
    private String errmsg;

    public Fuelling() {
    }

    public Fuelling(Long id) {
        this.id = id;
    }

    public Fuelling(Long id, long dispenser, long fuel, long price, Date requested, long reqvolume, long reqpaysum, FuellingStatus status, Date fuelled) {
        this.id = id;
        this.dispenser = dispenser;
        this.fuel = fuel;
        this.price = price;
        this.requested = requested;
        this.reqvolume = reqvolume;
        this.reqpaysum = reqpaysum;
        this.status = status;
        this.fuelled = fuelled;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public long getDispenser() {
        return dispenser;
    }

    public void setDispenser(long dispenser) {
        this.dispenser = dispenser;
    }

    public long getFuel() {
        return fuel;
    }

    public void setFuel(long fuel) {
        this.fuel = fuel;
    }

    public long getPrice() {
        return price;
    }

    public void setPrice(long price) {
        this.price = price;
    }

    public Date getRequested() {
        return requested;
    }

    public void setRequested(Date requested) {
        this.requested = requested;
    }

    public long getReqvolume() {
        return reqvolume;
    }

    public void setReqvolume(long reqvolume) {
        this.reqvolume = reqvolume;
    }

    public long getReqpaysum() {
        return reqpaysum;
    }

    public void setReqpaysum(long reqpaysum) {
        this.reqpaysum = reqpaysum;
    }

    public FuellingStatus getStatus() {
        return status;
    }

    public void setStatus(FuellingStatus status) {
        this.status = status;
    }

    public Date getFuelled() {
        return fuelled;
    }

    public void setFuelled(Date fuelled) {
        this.fuelled = fuelled;
    }

    public BigInteger getFuelVolume() {
        return fuelvolume;
    }

    public void setFuelVolume(BigInteger fuelvolume) {
        this.fuelvolume = fuelvolume;
    }

    public BigInteger getFuelPaySum() {
        return fuelpaysum;
    }

    public void setFuelPaySum(BigInteger fuelpaysum) {
        this.fuelpaysum = fuelpaysum;
    }

    public String getErrmsg() {
        return errmsg;
    }

    public void setErrmsg(String errmsg) {
        this.errmsg = errmsg;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (id != null ? id.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Fuelling)) {
            return false;
        }
        Fuelling other = (Fuelling) object;
        if ((this.id == null && other.id != null) || (this.id != null && !this.id.equals(other.id))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.pbv.azsg.domain.Fuelling[ id=" + id + " ]";
    }
    
}
